<style type="text/css">
.customp p {
    width: 280px;
}

.my-uploadify-button {
    background: none;
    border: none;
    text-shadow: none;
    border-radius: 0;
}

.uploadify:hover .my-uploadify-button {
    background: none;
    border: none;
}

.fileQueue {
    width: 260px;
    height: 100px;
    overflow: auto;
    border: 1px #d8dfe5 solid;
    border-color: #E5E5E5;
}

.uploadify-queue-item {
    padding: 0px;
}

#fileupload {
    margin-bottom: 5px;
}
</style>
<div class="pageContent">
    <form method="post" id=processOperationForm name="processOperationForm" action="${rc.getContextPath()}/manage/process/updateProcess" class="pageForm required-validate" onsubmit="return processOperationJs._processValidateCallback(this);">
        <div class="pageFormContent customp">
            <input type="hidden" id="processOprationDelIds" name="processOprationDelIds"/><!--存储已存在的删除的工序id -->
            <input type="hidden" id="processOprationAddIds" name="processOprationAddIds"/><!--存储现在的工序id，新增的工序，工艺code为temp的是临时的 -->
            <input type="hidden" name="navTabId" value="${navTabId!''}" />
            <p>
                <label><@label key='cmprocess_code.C,colon'>工艺编号：</@label></label>
                <input type="text" name="processCode" maxlength="20" class="required" readonly value="${processModel.processCode!''}" />
            </p>
            <p>
                <label><@label key='cmprocessrev.C,colon'>版本号：</@label></label>
                <input type="text" name="processRev" maxlength="20" value="${processModel.processRev!''}" readonly class="required" />
            </p>
            <p>
                <label><@label key='cmprocess_name.C,colon'>工艺名称：</@label></label>
                <input type="text" name="processText" value="${processModel.processText!''}" maxlength="60" class="required"/>
            </p>
            <p class="notnormal">
                <label><@label key='effectiveDate.C,colon'>生效时间：</@label></label>
                <input type="text" name="effectiveDate" readonly class="required date" value="${(processModel.effectiveDate?string('yyyy-MM-dd HH:mm:ss'))?if_exists}" mindate="%y-%M-%d" max_Date="{expirationDate}" datefmt="yyyy-MM-dd HH:mm:ss"/>
                <a class="inputDateButton" href="javascript:;">选择</a>
            </p>
            <p class="notnormal">
                <label><@label key='expirationDate.C,colon'>失效时间：</@label></label>
                <input type="text" name="expirationDate" readonly class="date" value="${(processModel.expirationDate?string('yyyy-MM-dd HH:mm:ss'))?if_exists}" min_Date="{effectiveDate}" datefmt="yyyy-MM-dd HH:mm:ss"/>
                <a class="inputDateButton" href="javascript:;">选择</a>
            </p>
            <p class="notnormal">
                <label><@label key='workCenter_type.C,colon'>工作中心类型：</@label></label>
                <input name="workCenterTypeCode" id="workCenterType.code" value="${processModel.workCenterTypeCode!''}" type="hidden"/>
                <input class="required look" name="workCenterTypeText" id="workCenterType.name" type="text" value="${processModel.typeText!''}" />
                <a class="btnLook" href="${rc.getContextPath()}/manage/workCenterType/workCenterTypeLookup" lookupGroup="workCenterType"><@label key="selected_first.C">请选择</@label></a>    
            </p>
            <p>
                <label><@label key="lockFlag.C,colon">锁定标记：</@label></label>
                <label><input type="checkbox" name="lockFlag" value="1" <#if (processModel.lockFlag)?? && (processModel.lockFlag == 1)> checked="true"</#if>><@label key="lock.C">锁定</@label></label>                
            </p>
        </div>
    </form>
        <#if processModel??> <#assign createInfo=processModel/> 
            <#include "/common/createInfo_width.html"> </#if>
        <div class="unitBox" style="float: left; display: block; overflow: hidden; width: 50%; background: #fff;
        border-bottom: 1px #d8dfe5 solid;border-left: 1px #d8dfe5 solid;border-right: 1px #d8dfe5 solid" >
            <div class="panelBar">
                <ul class="toolBar">
                    <li><a class="add" target="dialog" mask="true" width="660" height="600" rel="processOperation_dialog" title="新增工序"
                    href="${rc.getContextPath()}/manage/process/addProcessOperation"><span><@label key="add.B">新增</@label></span></a></li>
                    <li><a class="edit" target="dialog" mask="true" width="660" height="600" rel="processOperation_dialog" title="编辑工序"
                    href="${rc.getContextPath()}/manage/process/editProcessOperation?popId={processOprationId_selected}"><span><@label key="edit.B">编辑</@label></span></a></li>
                </ul>
            </div>
            <input type="hidden" id="processOprationId_selected" /> <!-- 暂存选择的工艺id -->
            <table id="processOprationTable" class="table canopration" style="width: 100%;" layoutH="230">
                <thead>
                    <tr>
                        <th width="50"><@label key="operation.C,serialNumber.C">工序序号</@label></th>
                        <th width="50"><@label key="operationCode.C">工序编号</@label></th>
                        <th width="100"><@label key="operation.C,name.C">工序名称</@label></th>
                        <th width="50"><@label key="operationType.C">工序类型</@label></th>
                        <th width="30"><@label key="confirmPoint.C">确认点</@label></th>
                        <th width="50px"><@label key="opera.C">操作</@label></th>
                    </tr>
                </thead>
                <tbody>
                    <#if processOperations??>
                        <#list processOperations as pop>
                            <tr id="${pop.id!''}" type="${pop.operationTypeEcode!''}" onclick="processOperationJs._showProcessAttachment(this);">
                                <td>${pop.operationOrdinal!''}</td>
                                <td>${pop.operationCode!''}</td>
                                <td>${pop.operationText!''}</td>
                                <td>
                                    <#if operationTypeECode??>
                                     <#list operationTypeECode as eCode>
                                     <#if eCode.eCode==pop.operationTypeEcode>
                                        ${eCode.eCodeText!''}
                                    </#if>
                                    </#list> 
                                    </#if>
                                </td>
                                <td><#if pop.confirmFlag == 1><@label key='yes.C'>是</@label><#else><@label key='no.C'>否</@label></#if></td>
                                <td><a title="<@label key='delete.B'>删除</@label>" target="ajax" class="btnDel" onclick="processOperationJs._delProcessOpration(${pop.id!''},'old');"><@label key="delete.B">删除</@label></a></td>
                            </tr>
                        </#list>
                    </#if>
                </tbody>
            </table>
        </div>
        <div class="unitBox" style="float: right; display: block; border-bottom: 1px #d8dfe5 solid;overflow: hidden; width: 49%; background: #fff">
            
            <div class="tabs">
                <div class="tabsHeader">
                    <div class="tabsHeaderContent">
                        <ul>
                            <li id="component" data-selectedid="processOperation_component" class="exerInputS"><a href="javascript:;" id="select1"><span><@label key='attachment.C'>工艺附件</@label></span></a></li>
                            <li id="Capacity" data-selectedid="processOperation_Capacity" class="exerInputS"><a href="javascript:;" id="select4"><span><@label key='cmprocessCapacity.C'>工艺产能</@label></span></a></li>
                            <li id="attachment" data-selectedid="processOperation_attachment" class="exerInputS"><a href="javascript:;" id="select2"><span><@label key='component.C'>组件</@label></span></a></li>
                            <li id="quality" data-selectedid="processOperation_quality" class="exerInputS"><a href="javascript:;" id="select3"><span><@label key='qualityOperation.C'>质量工序设置</@label></span></a></li>
                        </ul>
                    </div>
                </div>
                <div class="tabsContent">
                    <div>
                        <table class="table canopration" style="width: 100%;" layoutH="235" id="processAttachMentTable">
                            <thead>
                                <tr>
                                    <th width="100px"><@label key='fileName.C'>文件名称</@label></th>
                                    <th width="100px"><@label key='fileSize.C'>文件大小(bytes)</@label></th>
                                    <th width="100px"><@label key='version.C'>版本</@label></th>
                                    <th width="50px"><@label key="opera.C">操作</@label></th>
                                </tr>
                            </thead>
                            <tbody>
                                
                            </tbody>
                        </table>
                    </div>
                    <div>
		                <table id="processCapacityTable" class="table canopration" style="width: 100%;" layoutH="235">
		                    <thead>
		                        <tr>
		                            <th width="70px"><@label key="workUnitCode.C">作业单元编号</@label></th>
		                            <th width="70px"><@label key="workUnitText.C">作业单元名称</@label></th>
		                            <th width="50px"><@label key="standardCapacity.C">标准产能</@label></th>
		                            <th width="70px"><@label key="standardHours.C">标准用时</@label></th>
		                        </tr>
		                    </thead>
		                    <tbody>
		                    </tbody>
		                </table>
		            </div>
                    <div>
                        <table id="processComponentTable" class="table canopration" style="width: 100%;" layoutH="235">
                            <thead>
                                <tr>
                                    <th width="50px"><@label key="component.C,code.C">组件编号</@label></th>
                                    <th width="100px"><@label key="component.C,name.C">组件名称</@label></th>
                                    <th width="30px"><@label key="quantity.C">数量</@label></th>
                                </tr>
                            </thead>
                            <tbody>
                                
                            </tbody>
                        </table>
                    </div>
                    <div>
                        <div class="pageHeader">
                            <fieldset class="pageFormContent">
                                <dl>
                                    <dt>选择采集方式</dt>
                                    <dd>
                                        <input type="checkbox" name="textcollectFlag" disabled="disabled" value="1"/>文本
                                        <input type="checkbox" name="graphcollectFlag" disabled="disabled" value="1"/>图形
                                    </dd>
                                </dl>
                                <dl>
                                    <dt>默认采集方式</dt>
                                    <dd>
                                        <select name="collectModeEcode" disabled="disabled">
                                            <#if defectcollectMode??>
                                                <#list defectcollectMode as ecode>
                                                    <option value="${ecode.eCode!''}">${ecode.eCodeText!''}</option>
                                                </#list>
                                            </#if>
                                        </select>
                                    </dd>
                                </dl>
                            
                            </fieldset>        
                        </div>
                        <table class="table canopration" style="width: 100%;" layoutH="328" id="processInspectPicTable">
                            <thead>
                                <tr>
                                    <th width="100px"><@label key='fileName.C'>文件名称</@label></th>
                                    <th width="100px"><@label key='fileSize.C'>文件大小(bytes)</@label></th>
                                    <th width="50px"><@label key="opera.C">操作</@label></th>
                                </tr>
                            </thead>
                            <tbody>
                                
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive" id="processOperation_save"><div class="buttonContent"><button type="submit"><@label key="save.B">保存</@label></button></div></div>
                </li>
                <li>
                    <div class="buttonActiveGrey"><div class="buttonContent"><button type="button" class="close"><@label key="cancel.B">取消</@label></button></div></div>
                </li>
            </ul>
        </div>
</div>
<script type="text/javascript">
$(function(){    
        setTimeout(function(){
            $($process_jtabs[2]).hide();
            $($process_jgroups[2]).hide();
            $($process_jtabs[3]).hide();
            $($process_jgroups[3]).hide();
            $("div#uploadProcessInspectPicture").hide();
            $("#processOprationTable .gridTbody", processEditDialog).find("table tbody").find("tr:first").click();
            $("div#processOperation_save", processEditDialog).click(function(){
                $("#processOperationForm").submit();
            });
        }, 0);
    })
    
    var processEditDialog = $.pdialog.getCurrent();
    
    var $process_jTabHeader = $("> .tabsHeader", $("div.tabs", processEditDialog));
    
    var $process_jtabs = $(">.tabsHeaderContent>ul li", $process_jTabHeader);
    
    var $process_jgroups = $("> .tabsContent > *", $("div.tabs", processEditDialog));
    
    var processOperationJs = {
        
        _addProcessOperations : function(data, dialogId){
            if(!data || !data.id)
                return;
            var gridTheadTh = $("#processOprationTable", processEditDialog).find("table thead th");
            var tr = "<tr id='"+data.id+"' type='"+data.operationTypeEcode+"' onclick='processOperationJs._showProcessAttachment(this)'>";
            tr += "<td style='width:"+$(gridTheadTh[0]).width()+"px'><div>"+data.operationOrdinal+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div>"+data.operationCode+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[2]).width()+"px'><div>"+data.operationText+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[3]).width()+"px'><div>"+data.operationTypeText+"</div></td>";
            if(data.confirmFlag==1){
                tr += "<td style='width:"+$(gridTheadTh[4]).width()+"px'><div>是</div></td>";
            }else{
                tr += "<td style='width:"+$(gridTheadTh[4]).width()+"px'><div>否</div></td>";
            }
            tr += "<td style='width:"+$(gridTheadTh[5]).width()+"px'><a title='<@label key='delete.B'>删除</@label>' target='ajax' class='btnDel' onclick='processOperationJs._delProcessOpration(\""+data.id+"\");'><@label key='delete.B'>删除</@label></a></td>";
            tr += "</tr>";
            $("#processOprationTable .gridTbody", processEditDialog).find("table tbody").append(tr);
            
            $("#processOprationTable .gridTbody", processEditDialog).find("table tbody").find("tr#"+data.id).click();
            processOperationJs._updateProcessOprationIds(data.id, 'add');
            $.pdialog.close(dialogId);
        },
        

        _modifyProcessOperations : function(data) {
            if(!data || !data.id)
                return;
            var gridTheadTh = $("#processOprationTable", processEditDialog).find("table thead th");
            var tr = "<tr id='"+data.id+"' type='"+data.operationTypeEcode+"' onclick='processOperationJs._showProcessAttachment(this)'>";
            tr += "<td style='width:"+$(gridTheadTh[0]).width()+"px'><div>"+data.operationOrdinal+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div>"+data.operationCode+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[2]).width()+"px'><div>"+data.operationText+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[3]).width()+"px'><div>"+data.operationTypeText+"</div></td>";
            if(data.confirmFlag==1){
                tr += "<td style='width:"+$(gridTheadTh[4]).width()+"px'><div>是</div></td>";
            }else{
                tr += "<td style='width:"+$(gridTheadTh[4]).width()+"px'><div>否</div></td>";
            }
            if(data.processCode!="PROCESSCODE_TEMP"){
                tr += "<td style='width:"+$(gridTheadTh[5]).width()+"px'><a title='<@label key='delete.B'>删除</@label>' target='ajax' class='btnDel' onclick='processOperationJs._delProcessOpration(\""+data.id+"\",\"old\");'><@label key='delete.B'>删除</@label></a></td>";
            }else{
                tr += "<td style='width:"+$(gridTheadTh[5]).width()+"px'><a title='<@label key='delete.B'>删除</@label>' target='ajax' class='btnDel' onclick='processOperationJs._delProcessOpration(\""+data.id+"\");'><@label key='delete.B'>删除</@label></a></td>";
            }
            tr += "</tr>";
            var $tr = $("#processOprationTable .gridTbody", processEditDialog).find("table tbody").find("tr#"+data.id);
            $tr.after(tr);$tr.remove();
            $("#processOprationTable .gridTbody", processEditDialog).find("table tbody").find("tr#"+data.id).click();
        },
        
        _delProcessOpration : function(_id, type){
            var evt = window.event || arguments.callee.caller.arguments[0];
            evt.stopPropagation();
            if(_id){
                alertMsg.confirm("<@label key='delete_sure.D'>确定删除</@label>？",{
                    okCall:function(){
                        if(type && type == "old"){ //已存在的删除，缓存起来
                            var popIds = $("input#processOprationDelIds").val();
                            if(!popIds || popIds == null || popIds == "")
                                popIds = ",";
                            popIds += _id;
                            popIds += ",";
                            $("input#processOprationDelIds").val(popIds);
                            $("#processOprationTable .gridTbody", processEditDialog).find('tr#'+_id).remove();
                        }else{//新增的删除直接删除
                            $.DWZajax({
                                url:hostUrl +"/process/delProcessOpration",
                                data:{'id':_id},
                                callback:function(data){
                                    $("#processOprationTable .gridTbody", processEditDialog).find('tr#'+_id).remove();
                                    processOperationJs._updateProcessOprationIds(_id, 'del');
                                    processOperationJs._clearCompAndOperation();
                                }
                            });
                        }
                    }
                });
            }
        },
        
        _updateProcessOprationIds : function(_id, type) {
            var popIds = $("input#processOprationAddIds", processEditDialog).val();
            if(!popIds || popIds == null || popIds == "")
                popIds = ",";
            var rexp = ","+_id+","
            if(type == "del"){
                popIds = popIds.replace(rexp, ",");
            }else if(type == "add"){
                popIds += _id;
                popIds += ",";
            }
            
            $("input#processOprationAddIds", processEditDialog).val(popIds);
        },
        
        _showProcessAttachment : function(_this) {    
            var $trs = $("#processOprationTable .gridTbody", processEditDialog).find('tr');
            $trs.filter(".selected").removeClass("selected");
            $(_this).addClass("selected");
            var _popId = $(_this).attr("id");
            var operationTypeEcode = $(_this).attr("type");
            
            if(operationTypeEcode == "QUALITY"){
                processOperationJs._qualitytabsShow();
            }else{
                processOperationJs._productiontabsShow();
            }
            if(_popId){
                $("input#processOprationId_selected", processEditDialog).val(_popId);
                processOperationJs._clearCompAndOperation();
                $.DWZajax({
                    url:hostUrl +"/process/fechProcessAttachmentAndComment",
                    data:{'id':_popId},
                    callback:function(data){
                        if(data){
                            var atts = data.attachment;
                            if(atts && atts.length > 0){
                                for(var i=0; i<atts.length; i++){
                                    processOperationJs._addProcessAttachment(atts[i]);
                                }
                            }
                          	//工序作业单元产能
                            var capacits = data.capacity;
                            if(capacits && capacits.length > 0){
                            	for(var i=0; i<capacits.length; i++){
                            		processOperationJs._addProcessCapacity(capacits[i]);
                                }
                            }
                            //质量工序
                            if(data.operationTypeEcode && data.operationTypeEcode=="QUALITY"){
                                $("select[name='collectModeEcode']").val(data.collectModeEcode);
                                if(data.textcollectFlag == 1)$("input[name='textcollectFlag']",processEditDialog).attr("checked",true);
                                if(data.graphcollectFlag ==1)$("input[name='graphcollectFlag']",processEditDialog).attr("checked",true);
                                var picture = data.picture;
                                if(picture && picture.length > 0){
                                    for(var i=0; i<picture.length; i++){
                                        processOperationJs._addProcessInspectPic(picture[i]);
                                    }
                                }
                                
                            }else{//生产工序
                                var component = data.component;
                                if(component && component.length > 0){
                                    for(var i=0; i<component.length; i++){
                                        processOperationJs._addProcessComponent(component[i]);
                                    }
                                }
                                
                            }
                        }
                    }
                });
            }
        },
        
        _qualitytabsShow : function() {
            $($process_jtabs[0]).addClass("selected");
            $($process_jgroups[0]).show();
            $($process_jtabs[1]).show();
            $($process_jgroups[1]).hide();
            $($process_jtabs[2]).hide();
            $($process_jgroups[2]).hide();
            $($process_jtabs[3]).removeClass("selected");
            $($process_jtabs[3]).show();
            $($process_jgroups[3]).hide();
        },
        
        _productiontabsShow : function() {
            $($process_jtabs[0]).addClass("selected");
            $($process_jgroups[0]).show();
            $($process_jtabs[1]).show();
            $($process_jtabs[1]).removeClass("selected");
            $($process_jgroups[1]).hide();
            $($process_jtabs[2]).show();
            $($process_jtabs[2]).removeClass("selected");
            $($process_jgroups[3]).hide();
            $($process_jtabs[3]).hide();
            $($process_jgroups[3]).hide();
        },
        
        _addProcessAttachment : function(data) {
            if(!data)
                return;
            var gridTheadTh = $("#processAttachMentTable", processEditDialog).find("table thead th");
            var tr = "<tr id="+data.processOperationID+"_"+data.saveName+">";
            tr += "<td style='width:"+$(gridTheadTh[0]).width()+"px'><div>"+data.fileName+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div>"+Math.round(data.fileSize/1024)+"kb</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[2]).width()+"px'><div>"+data.version+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[3]).width()+"px'>";
            tr += "<a title='<@label key='download.B'>下载</@label>' target='dwzExport' class='btnAttach' href='${rc.getContextPath()}/manage/common/downloadAttachement?attachmentCode="+data.attachmentCode+"&fileName="+data.fileName+"'></a></td>"
            tr += "</tr>";
            $("#processAttachMentTable .gridTbody", processEditDialog).find("table tbody").append(tr);
        },
        
        _addProcessInspectPic : function(data) {
            if(!data)
                return;
            var gridTheadTh = $("#processInspectPicTable", processEditDialog).find("table thead th");
            var tr = "<tr id=processInspectPic_"+data.id+">";
            tr += "<td style='width:"+$(gridTheadTh[0]).width()+"px'><div>"+data.fileName+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div>"+Math.round(data.fileSize/1024)+"kb</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[2]).width()+"px'>";
            tr += "<a title='<@label key='download.B'>下载</@label>' target='dwzExport' class='btnAttach' href='${rc.getContextPath()}/manage/common/downloadAttachement?attachmentCode="+data.attachmentCode+"&fileName="+data.fileName+"'></a></td>"
            tr += "</tr>";
            $("#processInspectPicTable .gridTbody", processEditDialog).find("table tbody").append(tr);
        },
        
        _addProcessComponent : function(data) {
            if(!data || !data.processOperationID)
                return;
            var gridTheadTh = $("#processComponentTable", processEditDialog).find("table thead th");
            var _id = data.processOperationID+"_"+data.componentCode;
            var tr = "<tr id="+_id+">";
            tr += "<td style='width:"+$(gridTheadTh[0]).width()+"px'><div>"+data.componentCode+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div>"+data.componentText+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[2]).width()+"px'><div>"+data.quantity+"</div></td>";
            tr += "</tr>";
            $("#processComponentTable .gridTbody", processEditDialog).find("table tbody").append(tr);
        },
        
        _addProcessCapacity : function(data) {
            if(!data || !data.processOperationID)
                return;
            var gridTheadTh = $("#processCapacityTable", processEditDialog).find("table thead th");
            var _id = data.processOperationID+"_"+data.workUnitCode;
            var tr = "<tr id="+_id+">";
            tr += "<td style='width:"+$(gridTheadTh[0]).width()+"px'><div>"+data.workUnitCode+"</div></td>";
            if(data.workUnitText==null){
				tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div></div></td>";
            }else{
            	tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div>"+data.workUnitText+"</div></td>";
            }
            tr += "<td style='width:"+$(gridTheadTh[2]).width()+"px'><div>"+data.standardCapacity+"</div></td>";
            tr += "<td style='width:"+$(gridTheadTh[3]).width()+"px'><div>"+data.standardHours+"</div></td>";
            tr += "</tr>";
            $("#processCapacityTable .gridTbody", processEditDialog).find("table tbody").append(tr);
        },
        
        _clearCompAndOperation : function() {
            $("#processAttachMentTable .gridTbody", processEditDialog).find("table tbody").html("");
            $("#processComponentTable .gridTbody", processEditDialog).find("table tbody").html("");
            $("#processInspectPicTable .gridTbody", processEditDialog).find("table tbody").html("");
            $("#processCapacityTable .gridTbody", processEditDialog).find("table tbody").html("");
            $("input[name='textcollectFlag']", processEditDialog).attr("checked",false);
            $("input[name='graphcollectFlag']", processEditDialog).attr("checked",false);
        },
        
        _processValidateCallback : function(form) {
            var index_ = ",";
            var flag = true;
            $("#processOprationTable .gridTbody", processEditDialog).find("table tbody").find("tr").each(function(){
                var index = $(this).find("td:first").text();
                //第一次循环
                if(index_ == ","){
                    index_ += index;
                    index_ += ",";
                    return true;//继续下次循环
                }
                if(index_.indexOf(","+index+",") != -1){
                    flag = false;
                    return false;//跳出循环
                }else{
                    index_ += index;
                    index_ += ",";
                }
            });
            if(!flag){
                alertMsg.error("<@label key='operationOrdinalRepeat.M'>工序序号不能重复，请修改！</@label>");
                return false;
            }else{
                return validateCallback(form, dialogAjaxDone) 
            }
        }
    }
</script>
